<%--
    Document   : process
    Created on : Apr 7, 2011, 10:25:35 AM
    Author     : Muhammad Anis
--%>
<%@page import="system.allover"%>
<%@page import="java.util.List"%>
<%@page import="system.chatbetweenfriend"%>
<%@page import="tools.commandProcessor"%>
<%@page import="user.user"%>
<%@page import="tools.dbconnector"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="tools.writer" %>
<jsp:useBean id="allover" class="system.allover" scope="application" />

<%

            String task = request.getParameter("task");
            if (task != null) {
                dbconnector db = new dbconnector(out);
                if(task.equals("loadRoom")){
                    allover = new allover();
                    allover.print(out);
                } else if(task.equals("updateKat")){
                    
                } else if(task.equals("update")){
                    allover.update(out);
                } else if(task.equals("vision")){
                    String visibility = request.getParameter("status");
                    String name = request.getParameter("catname");
                    allover.setVisibility(visibility,name);
                } else if(task.equals("addchatroom")){
                    String roomname = request.getParameter("username");
                    user currentuser = (user)session.getAttribute("currentuser");
                    allover.addUserinroom(currentuser.username, roomname);
                }

            } else {
                writer.redirect("../index.jsp", out);
            }
%>